package tower;

import java.awt.Color;
import java.awt.Graphics;

import javax.swing.JFrame;
import javax.swing.JLabel;
/**
 * 
 * @author LocoRocoBattleStein
 *
 */
public class Carre extends JLabel {

	private int x;
	private int y;
	private int diameter;
	private Color color;
	
	public Carre(int x, int y, int diameter, Color color){
		this.x=x;
		this.y=y;
		this.diameter=diameter;
		this.color=color;
	}
	
	public void paint(Graphics g) {
		super.paint(g);
		g.setColor(color);
		g.fillRect(x, y, diameter, diameter);
	}

	
	public static void main(String[] args) {
		JFrame jf = new JFrame();
		jf.setSize(300,300);
		jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		jf.add(new Carre(100,100,20,Color.BLACK));
		jf.setVisible(true);
	}

}
